3.680 \(\int (a+i a \tan (e+f x))^2 (A+B \tan (e+f x)) (c-i c \tan (e+f x))^2 \, dx\)

Optimal. Leaf size=62 \[ \frac{a^2 A c^2 \tan ^3(e+f x)}{3 f}+\frac{a^2 A c^2 \tan (e+f x)}{f}+\frac{a^2 B c^2 \sec ^4(e+f x)}{4 f} \]

[Out]

(a^2*B*c^2*Sec[e + f*x]^4)/(4*f) + (a^2*A*c^2*Tan[e + f*x])/f + (a^2*A*c^2*Tan[e + f*x]^3)/(3*f)

________________________________________________________________________________________

Rubi [A]  time = 0.109028, antiderivative size = 62, normalized size of antiderivative = 1., number of steps used = 4, number of rules used = 3, integrand size = 41, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.073, Rules used = {3588, 73, 641} \[ \frac{a^2 A c^2 \tan ^3(e+f x)}{3 f}+\frac{a^2 A c^2 \tan (e+f x)}{f}+\frac{a^2 B c^2 \sec ^4(e+f x)}{4 f} \]

Antiderivative was successfully verified.

[In]

Int[(a + I*a*Tan[e + f*x])^2*(A + B*Tan[e + f*x])*(c - I*c*Tan[e + f*x])^2,x]

[Out]

(a^2*B*c^2*Sec[e + f*x]^4)/(4*f) + (a^2*A*c^2*Tan[e + f*x])/f + (a^2*A*c^2*Tan[e + f*x]^3)/(3*f)

Rule 3588

Int[((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_.)*((A_.) + (B_.)*tan[(e_.) + (f_.)*(x_)])*((c_) + (d_.)*tan[(e_
.) + (f_.)*(x_)])^(n_.), x_Symbol] :> Dist[(a*c)/f, Subst[Int[(a + b*x)^(m - 1)*(c + d*x)^(n - 1)*(A + B*x), x
], x, Tan[e + f*x]], x] /; FreeQ[{a, b, c, d, e, f, A, B, m, n}, x] && EqQ[b*c + a*d, 0] && EqQ[a^2 + b^2, 0]

Rule 73

Int[((a_) + (b_.)*(x_))^(m_.)*((c_) + (d_.)*(x_))^(n_.)*((e_.) + (f_.)*(x_))^(p_.), x_Symbol] :> Int[(a*c + b*
d*x^2)^m*(e + f*x)^p, x] /; FreeQ[{a, b, c, d, e, f, m, n, p}, x] && EqQ[b*c + a*d, 0] && EqQ[n, m] && Integer
Q[m]

Rule 641

Int[((d_) + (e_.)*(x_))*((a_) + (c_.)*(x_)^2)^(p_.), x_Symbol] :> Simp[(e*(a + c*x^2)^(p + 1))/(2*c*(p + 1)),
x] + Dist[d, Int[(a + c*x^2)^p, x], x] /; FreeQ[{a, c, d, e, p}, x] && NeQ[p, -1]

Rubi steps

\begin{align*} \int (a+i a \tan (e+f x))^2 (A+B \tan (e+f x)) (c-i c \tan (e+f x))^2 \, dx &=\frac{(a c) \operatorname{Subst}(\int (a+i a x) (A+B x) (c-i c x) \, dx,x,\tan (e+f x))}{f}\\ &=\frac{(a c) \operatorname{Subst}\left (\int (A+B x) \left (a c+a c x^2\right ) \, dx,x,\tan (e+f x)\right )}{f}\\ &=\frac{a^2 B c^2 \sec ^4(e+f x)}{4 f}+\frac{(a A c) \operatorname{Subst}\left (\int \left (a c+a c x^2\right ) \, dx,x,\tan (e+f x)\right )}{f}\\ &=\frac{a^2 B c^2 \sec ^4(e+f x)}{4 f}+\frac{a^2 A c^2 \tan (e+f x)}{f}+\frac{a^2 A c^2 \tan ^3(e+f x)}{3 f}\\ \end{align*}

Mathematica [A]  time = 0.15596, size = 53, normalized size = 0.85 \[ \frac{a^2 A c^2 \left (\frac{1}{3} \tan ^3(e+f x)+\tan (e+f x)\right )}{f}+\frac{a^2 B c^2 \sec ^4(e+f x)}{4 f} \]

Antiderivative was successfully verified.

[In]

Integrate[(a + I*a*Tan[e + f*x])^2*(A + B*Tan[e + f*x])*(c - I*c*Tan[e + f*x])^2,x]

[Out]

(a^2*B*c^2*Sec[e + f*x]^4)/(4*f) + (a^2*A*c^2*(Tan[e + f*x] + Tan[e + f*x]^3/3))/f

________________________________________________________________________________________

Maple [A]  time = 0.011, size = 53, normalized size = 0.9 \begin{align*}{\frac{{a}^{2}{c}^{2}}{f} \left ({\frac{B \left ( \tan \left ( fx+e \right ) \right ) ^{4}}{4}}+{\frac{A \left ( \tan \left ( fx+e \right ) \right ) ^{3}}{3}}+{\frac{B \left ( \tan \left ( fx+e \right ) \right ) ^{2}}{2}}+A\tan \left ( fx+e \right ) \right ) } \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a+I*a*tan(f*x+e))^2*(A+B*tan(f*x+e))*(c-I*c*tan(f*x+e))^2,x)

[Out]

1/f*a^2*c^2*(1/4*B*tan(f*x+e)^4+1/3*A*tan(f*x+e)^3+1/2*B*tan(f*x+e)^2+A*tan(f*x+e))

________________________________________________________________________________________

Maxima [A]  time = 1.65437, size = 97, normalized size = 1.56 \begin{align*} \frac{3 \, B a^{2} c^{2} \tan \left (f x + e\right )^{4} + 4 \, A a^{2} c^{2} \tan \left (f x + e\right )^{3} + 6 \, B a^{2} c^{2} \tan \left (f x + e\right )^{2} + 12 \, A a^{2} c^{2} \tan \left (f x + e\right )}{12 \, f} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+I*a*tan(f*x+e))^2*(A+B*tan(f*x+e))*(c-I*c*tan(f*x+e))^2,x, algorithm="maxima")

[Out]

1/12*(3*B*a^2*c^2*tan(f*x + e)^4 + 4*A*a^2*c^2*tan(f*x + e)^3 + 6*B*a^2*c^2*tan(f*x + e)^2 + 12*A*a^2*c^2*tan(
f*x + e))/f

________________________________________________________________________________________

Fricas [C]  time = 1.35671, size = 284, normalized size = 4.58 \begin{align*} \frac{{\left (12 i \, A + 12 \, B\right )} a^{2} c^{2} e^{\left (4 i \, f x + 4 i \, e\right )} + 16 i \, A a^{2} c^{2} e^{\left (2 i \, f x + 2 i \, e\right )} + 4 i \, A a^{2} c^{2}}{3 \,{\left (f e^{\left (8 i \, f x + 8 i \, e\right )} + 4 \, f e^{\left (6 i \, f x + 6 i \, e\right )} + 6 \, f e^{\left (4 i \, f x + 4 i \, e\right )} + 4 \, f e^{\left (2 i \, f x + 2 i \, e\right )} + f\right )}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+I*a*tan(f*x+e))^2*(A+B*tan(f*x+e))*(c-I*c*tan(f*x+e))^2,x, algorithm="fricas")

[Out]

1/3*((12*I*A + 12*B)*a^2*c^2*e^(4*I*f*x + 4*I*e) + 16*I*A*a^2*c^2*e^(2*I*f*x + 2*I*e) + 4*I*A*a^2*c^2)/(f*e^(8
*I*f*x + 8*I*e) + 4*f*e^(6*I*f*x + 6*I*e) + 6*f*e^(4*I*f*x + 4*I*e) + 4*f*e^(2*I*f*x + 2*I*e) + f)

________________________________________________________________________________________

Sympy [C]  time = 10.5884, size = 158, normalized size = 2.55 \begin{align*} \frac{\frac{16 i A a^{2} c^{2} e^{- 6 i e} e^{2 i f x}}{3 f} + \frac{4 i A a^{2} c^{2} e^{- 8 i e}}{3 f} + \frac{\left (4 i A a^{2} c^{2} + 4 B a^{2} c^{2}\right ) e^{- 4 i e} e^{4 i f x}}{f}}{e^{8 i f x} + 4 e^{- 2 i e} e^{6 i f x} + 6 e^{- 4 i e} e^{4 i f x} + 4 e^{- 6 i e} e^{2 i f x} + e^{- 8 i e}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+I*a*tan(f*x+e))**2*(A+B*tan(f*x+e))*(c-I*c*tan(f*x+e))**2,x)

[Out]

(16*I*A*a**2*c**2*exp(-6*I*e)*exp(2*I*f*x)/(3*f) + 4*I*A*a**2*c**2*exp(-8*I*e)/(3*f) + (4*I*A*a**2*c**2 + 4*B*
a**2*c**2)*exp(-4*I*e)*exp(4*I*f*x)/f)/(exp(8*I*f*x) + 4*exp(-2*I*e)*exp(6*I*f*x) + 6*exp(-4*I*e)*exp(4*I*f*x)
 + 4*exp(-6*I*e)*exp(2*I*f*x) + exp(-8*I*e))

________________________________________________________________________________________

Giac [B]  time = 1.68467, size = 555, normalized size = 8.95 \begin{align*} \frac{3 \, B a^{2} c^{2} \tan \left (f x\right )^{4} \tan \left (e\right )^{4} - 12 \, A a^{2} c^{2} \tan \left (f x\right )^{4} \tan \left (e\right )^{3} - 12 \, A a^{2} c^{2} \tan \left (f x\right )^{3} \tan \left (e\right )^{4} + 6 \, B a^{2} c^{2} \tan \left (f x\right )^{4} \tan \left (e\right )^{2} + 6 \, B a^{2} c^{2} \tan \left (f x\right )^{2} \tan \left (e\right )^{4} - 4 \, A a^{2} c^{2} \tan \left (f x\right )^{4} \tan \left (e\right ) + 24 \, A a^{2} c^{2} \tan \left (f x\right )^{3} \tan \left (e\right )^{2} + 24 \, A a^{2} c^{2} \tan \left (f x\right )^{2} \tan \left (e\right )^{3} - 4 \, A a^{2} c^{2} \tan \left (f x\right ) \tan \left (e\right )^{4} + 3 \, B a^{2} c^{2} \tan \left (f x\right )^{4} + 12 \, B a^{2} c^{2} \tan \left (f x\right )^{2} \tan \left (e\right )^{2} + 3 \, B a^{2} c^{2} \tan \left (e\right )^{4} + 4 \, A a^{2} c^{2} \tan \left (f x\right )^{3} - 24 \, A a^{2} c^{2} \tan \left (f x\right )^{2} \tan \left (e\right ) - 24 \, A a^{2} c^{2} \tan \left (f x\right ) \tan \left (e\right )^{2} + 4 \, A a^{2} c^{2} \tan \left (e\right )^{3} + 6 \, B a^{2} c^{2} \tan \left (f x\right )^{2} + 6 \, B a^{2} c^{2} \tan \left (e\right )^{2} + 12 \, A a^{2} c^{2} \tan \left (f x\right ) + 12 \, A a^{2} c^{2} \tan \left (e\right ) + 3 \, B a^{2} c^{2}}{12 \,{\left (f \tan \left (f x\right )^{4} \tan \left (e\right )^{4} - 4 \, f \tan \left (f x\right )^{3} \tan \left (e\right )^{3} + 6 \, f \tan \left (f x\right )^{2} \tan \left (e\right )^{2} - 4 \, f \tan \left (f x\right ) \tan \left (e\right ) + f\right )}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+I*a*tan(f*x+e))^2*(A+B*tan(f*x+e))*(c-I*c*tan(f*x+e))^2,x, algorithm="giac")

[Out]

1/12*(3*B*a^2*c^2*tan(f*x)^4*tan(e)^4 - 12*A*a^2*c^2*tan(f*x)^4*tan(e)^3 - 12*A*a^2*c^2*tan(f*x)^3*tan(e)^4 +
6*B*a^2*c^2*tan(f*x)^4*tan(e)^2 + 6*B*a^2*c^2*tan(f*x)^2*tan(e)^4 - 4*A*a^2*c^2*tan(f*x)^4*tan(e) + 24*A*a^2*c
^2*tan(f*x)^3*tan(e)^2 + 24*A*a^2*c^2*tan(f*x)^2*tan(e)^3 - 4*A*a^2*c^2*tan(f*x)*tan(e)^4 + 3*B*a^2*c^2*tan(f*
x)^4 + 12*B*a^2*c^2*tan(f*x)^2*tan(e)^2 + 3*B*a^2*c^2*tan(e)^4 + 4*A*a^2*c^2*tan(f*x)^3 - 24*A*a^2*c^2*tan(f*x
)^2*tan(e) - 24*A*a^2*c^2*tan(f*x)*tan(e)^2 + 4*A*a^2*c^2*tan(e)^3 + 6*B*a^2*c^2*tan(f*x)^2 + 6*B*a^2*c^2*tan(
e)^2 + 12*A*a^2*c^2*tan(f*x) + 12*A*a^2*c^2*tan(e) + 3*B*a^2*c^2)/(f*tan(f*x)^4*tan(e)^4 - 4*f*tan(f*x)^3*tan(
e)^3 + 6*f*tan(f*x)^2*tan(e)^2 - 4*f*tan(f*x)*tan(e) + f)